home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14745 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  47 lines

  1. Path: vixen.cso.uiuc.edu!usenet
  2. From: Dragos-Anton Manolescu <manolesc@uiuc.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Q: static private variables/functions
  5. Date: 01 Apr 1996 17:01:49 -0600
  6. Organization: University of Illinois at Urbana-Champaign
  7. Message-ID: <op3f6ntuoy.fsf@sweetbay.will.uiuc.edu>
  8. Reply-To: Dragos Manolescu <manolesc@uiuc.edu>
  9. NNTP-Posting-Host: sweetbay.will.uiuc.edu
  10. X-Newsreader: Gnus v5.1
  11.  
  12.  
  13. Hello,
  14.  
  15. I'm trying to use a class with several static private variables and
  16. functions. Here's a piece from my code (have left just one variable
  17. and one function to keep the code clear):
  18.  
  19. class Movie {
  20. private:
  21.   // Jpeg playback class variables
  22.   static XtAppContext appContext;
  23.   // Private functions
  24.   static void PrivateXtLoop(void);
  25. [stuff deleted]
  26. };
  27.  
  28. Everything compiles Ok but apparently the linker is not able to find
  29. the class variables:
  30.  
  31. /bin/ld: Unsatisfied symbols:
  32.    Movie::appContext  (data)
  33. *** Error code 1
  34. `all' not remade because of errors
  35.  
  36. All the class variables are private, and therefore used just by
  37. the member functions.
  38.  
  39. What am I doing wrong here? I use g++ 2.7.2 and libg++ 2.7.1.3, if
  40. that matters.
  41.  
  42. Please reply by e-mail, if possible.
  43.  
  44. Thank you in advance!
  45. -- 
  46. dam                                    http://www.uiuc.edu/ph/www/manolesc
  47.